package org.web.demo.servlet;

import lombok.extern.slf4j.Slf4j;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/**
 * 一个配置了各种路径匹配的Servlet。(没有实际作用，只是演示）
 *
 * @author yexi
 */
@Slf4j
public class GlobalServlet extends HttpServlet {

    public GlobalServlet() {
        log.info("GlobalServlet实例化");
    }

    @Override
    protected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        log.info("GlobalServlet开始处理服务");
    }

    @Override
    public void destroy() {
        log.info("GlobalServlet销毁");
    }

    @Override
    public void init() throws ServletException {
        log.info("GlobalServlet初始化");
    }
}
